package com.cz.video.website.service.impl;

import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cz.video.website.domain.WebsiteAccount;
import com.cz.video.website.domain.WebsiteCollectAndFolder;
import com.cz.video.website.mapper.WebsiteCollectAndFolderMapper;
import com.cz.video.website.service.IWebsiteCollectAndFolderService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 收藏表和收藏夹表的关联表 服务实现类
 * </p>
 *
 * @author yr
 * @since 2023-10-16
 */
@Service
@RequiredArgsConstructor
public class WebsiteCollectAndFolderServiceImpl extends ServiceImpl<WebsiteCollectAndFolderMapper, WebsiteCollectAndFolder> implements IWebsiteCollectAndFolderService {
    private final WebsiteCollectAndFolderMapper websiteCollectAndFolderMapper;

    /**
     * 校验收藏关系名称是否唯一
     *
     * @param websiteCollectAndFolder 收藏关系
     * @return 结果
     */
//    @Override
//    public boolean checkUserNameUnique(WebsiteCollectAndFolder websiteCollectAndFolder) {
//        boolean exist = websiteCollectAndFolderMapper.exists(new LambdaQueryWrapper<WebsiteCollectAndFolder>()
//            .eq(WebsiteCollectAndFolder::getWebsiteCollectAndFolderName, websiteCollectAndFolder.getWebsiteCollectAndFolderName())
//            .ne(ObjectUtil.isNotNull(websiteCollectAndFolder.getUserId()), WebsiteCollectAndFolder::getUserId, websiteCollectAndFolder.getUserId()));
//        return !exist;
//    }
}
